package org.me.entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@Entity
@Table(name = "T_PAISES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TPaises.findAll", query = "SELECT t FROM TPaises t ORDER BY t.nIdPaisPk"),
    @NamedQuery(name = "TPaises.findPaises1", query = "SELECT t FROM TPaises t WHERE t.nIdPaisPk != :nIdPaisPk ORDER BY t.nIdPaisPk"),
    @NamedQuery(name = "TPaises.findByNIdPaisPk", query = "SELECT t FROM TPaises t WHERE t.nIdPaisPk = :nIdPaisPk"),
    @NamedQuery(name = "TPaises.findByVNombrePais", query = "SELECT t FROM TPaises t WHERE t.vNombrePais = :vNombrePais"),
    @NamedQuery(name = "TPaises.findPaisConDptos", query = "SELECT t FROM TPaises t LEFT JOIN FETCH t.tDepartamentosList WHERE t.nIdPaisPk = :nIdPaisPk"),
    @NamedQuery(name = "TPaises.findByNNumHabitantesPais", query = "SELECT t FROM TPaises t WHERE t.nNumHabitantesPais = :nNumHabitantesPais")})

public class TPaises implements Serializable {  
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nIdPaisDomicilioNotariaFk")
    private List<TNotarias> tNotariasList;
    
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "N_ID_PAIS_PK")
    @SequenceGenerator(name="SEQ_PAIS",sequenceName="SEQ_PAIS",allocationSize=1)
    @GeneratedValue(generator="SEQ_PAIS")
    private Short nIdPaisPk;
    @Column(name = "V_NOMBRE_PAIS")
    private String vNombrePais;
    @Column(name = "N_NUM_HABITANTES_PAIS")
    private Long nNumHabitantesPais;
    @OneToMany(mappedBy = "nIdPaisDomicilioCteFk")
    private List<TClientes> tClientesList;
    @OneToMany(mappedBy = "nIdPaisCentroTrabajoFk")
    private List<TClientes> tClientesList1;
    @OneToMany(mappedBy = "nIdPaisFk")
    private List<TCentroEstudios> tCentroEstudiosList;
    @OneToMany(mappedBy = "nIdPaisFk")
    private List<TDepartamentos> tDepartamentosList;

    public TPaises() {
    }

    public TPaises(Short nIdPaisPk) {
        this.nIdPaisPk = nIdPaisPk;
    }

    public Short getNIdPaisPk() {
        return nIdPaisPk;
    }

    public void setNIdPaisPk(Short nIdPaisPk) {
        this.nIdPaisPk = nIdPaisPk;
    }

    public String getVNombrePais() {
        return vNombrePais;
    }

    public void setVNombrePais(String vNombrePais) {
        this.vNombrePais = vNombrePais;
    }

    public Long getNNumHabitantesPais() {
        return nNumHabitantesPais;
    }

    public void setNNumHabitantesPais(Long nNumHabitantesPais) {
        this.nNumHabitantesPais = nNumHabitantesPais;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nIdPaisPk != null ? nIdPaisPk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TPaises)) {
            return false;
        }
        TPaises other = (TPaises) object;
        if ((this.nIdPaisPk == null && other.nIdPaisPk != null) || (this.nIdPaisPk != null && !this.nIdPaisPk.equals(other.nIdPaisPk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entityBeans.TPaises[ nIdPaisPk=" + nIdPaisPk + " ]";
    }

    @XmlTransient
    public List<TClientes> getTClientesList() {
        return tClientesList;
    }

    public void setTClientesList(List<TClientes> tClientesList) {
        this.tClientesList = tClientesList;
    }

    @XmlTransient
    public List<TClientes> getTClientesList1() {
        return tClientesList1;
    }

    public void setTClientesList1(List<TClientes> tClientesList1) {
        this.tClientesList1 = tClientesList1;
    }

    @XmlTransient
    public List<TCentroEstudios> getTCentroEstudiosList() {
        return tCentroEstudiosList;
    }

    public void setTCentroEstudiosList(List<TCentroEstudios> tCentroEstudiosList) {
        this.tCentroEstudiosList = tCentroEstudiosList;
    }

    @XmlTransient
    public List<TDepartamentos> getTDepartamentosList() {
        return tDepartamentosList;
    }

    public void setTDepartamentosList(List<TDepartamentos> tDepartamentosList) {
        this.tDepartamentosList = tDepartamentosList;
    }

    @XmlTransient
    public List<TNotarias> getTNotariasList() {
        return tNotariasList;
    }

    public void setTNotariasList(List<TNotarias> tNotariasList) {
        this.tNotariasList = tNotariasList;
    }

    

}
